import type { AddressItem, OrderDetail, OrderPre } from "@/types/medicalorder";
import type { Logistics } from "@/types/oreder";
import { request } from "@/utils/request";
/**
 * 订单-查询收货地址列表
 * @returns 
 */
export const QueryAdress =() => request<AddressItem[]>('/patient/order/address')  
/**
 * 获取预支付信息
 * @param params 
 * @returns 
 */
export const getMedicalOrderPre = (params:{prescriptionId: string}) => request<OrderPre>('/patient/medicine/order/pre','GET',params)
/**
 *获取药品订单
 * @param data 
 * @returns 
 */
export const  getMedicalOrder = (data:{id:string,couponId?:string,addressId:string}) => request<{id:string}>('/patient/medicine/order','POST',data)
/**
 * 获取药品订单详情
 * @param id 
 * @returns 
 */
export const getMedicalOrderDetailAPI = (id:string) => request<OrderDetail>(`/patient/medicine/order/detail/${id}`)
/**
 * 订单-查询物流信息
 * @param id 订单id
 * @returns Promise对象
 */
export const getMedicalOrderLogistics = (id:string) => request<Logistics>(`/patient/order/${id}/logistics`)